//
//  LogisticsHeader.m
//  PigMarket
//
//  Created by 张敬 on 2019/8/19.
//  Copyright © 2019年 pigmarket.oc. All rights reserved.
//

#import "LogisticsHeader.h"

@implementation LogisticsHeader

#pragma mark - lifecycle methods

- (void)setupUI
{
    [self addSubview:self.bgIcon];
    
    [self addSubview:self.cartIcon];
    [self addSubview:self.signLab];
    [self addSubview:self.namePhoneLab];
    [self addSubview:self.locationLab];
    [self addSubview:self.tipLab];
    [self addSubview:self.numberLab];

    
    
}


- (void)setupLayout
{
    self.height = 248 + TJ_StatusBarHeight;
    
    {
        _bgIcon.size = CGSizeMake(KScreenWidth, TJ_StatusBarHeight + 194);
        _bgIcon.mj_x = _bgIcon.mj_y = 0;
    }
    
    
    {
        _cartIcon.size = CGSizeMake(20, 20);
        _cartIcon.mj_x = 15;
        _cartIcon.mj_y = TJ_StatusBarHeight + 75;
    }
    
    
    {
        _signLab.mj_x = _cartIcon.right + 5;
        _signLab.mj_y = _cartIcon.mj_y;
        _signLab.size = CGSizeMake(KScreenWidth - 155, 21);
    }
    
    
    {
        _namePhoneLab.size = CGSizeMake(KScreenWidth - 60, 18);
        _namePhoneLab.mj_x = 15;
        _namePhoneLab.mj_y = _signLab.bottom + 22;
    }
    
    
    {
        _locationLab.frame = _namePhoneLab.frame;
        _locationLab.mj_y = _namePhoneLab.bottom + 4;
    }
    
    
    {
        _tipLab.size = CGSizeMake(100, 54);
        _tipLab.mj_x = 15;
        _tipLab.mj_y = _bgIcon.bottom;
    }
    
    
    {
        _numberLab.size = CGSizeMake(200, 54);
        _numberLab.mj_x = KScreenWidth - 15 - _numberLab.width;
        _numberLab.mj_y = _tipLab.mj_y;
    }
    
}

#pragma mark - setter methods
#pragma mark - getter methods

- (UIImageView *)bgIcon{
    
    if (!_bgIcon) {
        _bgIcon = [UIImageView new];
        _bgIcon.image = [UIImage imageNamed:@"Meat_Logistics_bg"];
    }
    return _bgIcon;
}


- (UIImageView *)cartIcon{
    
    if (!_cartIcon) {
        _cartIcon = [[UIImageView alloc] init];
        _cartIcon.image = [UIImage imageNamed:@"Meat_Logistics_CartLogo"];
    }
    return _cartIcon;
}


- (UILabel *)signLab{
    
    if (!_signLab) {
        _signLab = [UILabel makeLabelWithText:@"您的订单已签收" textColor:KWhiteColor font:mFont(15) textAliment:0];
    }
    return _signLab;
}


- (UILabel *)namePhoneLab{
    
    if (!_namePhoneLab) {
        _namePhoneLab = [UILabel makeLabelWithText:@"傅小小 18227387820" textColor:KWhiteColor font:mFont(12) textAliment:0];
    }
    return _namePhoneLab;
}


- (UILabel *)tipLab{
    
    if (!_tipLab) {
        _tipLab = [UILabel makeLabelWithText:@"订单状态跟踪" textColor:UIColorFromRGB(0x333333) font:mFont(14) textAliment:0];
    }
    return _tipLab;
}


- (UILabel *)numberLab{
    
    if (!_numberLab) {
        _numberLab = [UILabel makeLabelWithText:@"订单编号：749237593652322" textColor:UIColorFromRGB(0x999999) font:mFont(12) textAliment:2];
    }
    return _numberLab;
}


- (UILabel *)locationLab{
    
    if (!_locationLab) {
        _locationLab = [UILabel makeLabelWithText:@"天津市武清区创业总部基地B区12号楼1208室" textColor:KWhiteColor font:mFont(13) textAliment:0];
    }
    return _locationLab;
}


@end
